ALTER TABLE StockInDetail DROP COLUMN SubjectCode
ALTER TABLE StockInDetail ADD AccountCode NVARCHAR(4) NOT NULL
alter table StockInDetail
   add constraint FK_Account_StockInDetail foreign key (AccountCode)
      references Account (Code)
GO

ALTER TABLE StockIn DROP COLUMN FromSubjectCode
ALTER TABLE StockIn ADD AccountCode NVARCHAR(4) NOT NULL
alter table StockIn
   add constraint FK_Account_StockIn foreign key (AccountCode)
      references Account (Code)
GO